using UnityEngine;

public class butFly : MonoBehaviour
{
	private HeliController controller
	{
		get
		{
			if (GameController.instance.carScript.GetType() == typeof(HelicopterBehavior))
			{
				return ((HelicopterBehavior)GameController.instance.carScript).heliContollerScript;
			}
			return null;
		}
	}

	private void OnDragOver(GameObject draggedObject)
	{
		if ((bool)controller)
		{
			controller.IsFlying = true;
		}
	}

	private void OnDragOut(GameObject draggedObject)
	{
		if ((bool)controller)
		{
			controller.IsFlying = false;
		}
	}

	private void OnDrop(GameObject draggedObject)
	{
		if ((bool)controller)
		{
			controller.IsFlying = false;
		}
	}

	private void OnPress(bool isDown)
	{
		if ((bool)controller)
		{
			controller.IsFlying = isDown;
		}
	}
}
